<template>
	<view>
		<view v-for="item in classroomList" >
			<itemList :building="item.rBuilding" :room="item.rRoom" :seat="item.rNums - item.rCanables" :rId="item.rId" @getClick = "getRid"></itemList>
		</view>		
	</view>
</template>

<script>
	import itemList from "../../components/itemList3.vue"
	export default {
		
		data() {
			return {
         classroomList:{}
			}
		},
		onLoad() {
			this.getClassList()
		},
		methods: {
			async getClassList(){
				const res = await this.$myRequest({
					url:"/getAllOpenClassroomsList"
				}).then(res =>{
					console.log("resList=>",res)
					this.classroomList = res.data.data
					console.log("this.classroomList=>",this.classroomList)
				})
			},
			 getRid(rId){
				 uni.navigateTo({
				 	url:"/pages/attendance/stuentatten?rId=" + rId
				 })
				// const res =  this.$myRequest({
				// 	url:"/queryUserfulBookingList/"+ rId
				// }).then(res =>{
				// 	console.log("ccres=>",res)
				// })
			}
		
		},
		components:{
			itemList
		}
	}
</script>

<style>

</style>
